package com.minhua.jijiehao2.mainframe.home.menulistactivity.impl

import com.minhua.jijiehao2.base.BaseMvpPresenter
import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.ChannelBean
import com.minhua.jijiehao2.constants.DefineKey
import com.minhua.jijiehao2.http.CallBack
import com.minhua.jijiehao2.http.ParamsMap
import com.minhua.jijiehao2.mainframe.home.menulistactivity.imp.IMenuListPresenter
import com.minhua.jijiehao2.mainframe.home.menulistactivity.imp.IMenuListView

class MenuListPresenter : BaseMvpPresenter<IMenuListView>(), IMenuListPresenter {

    private val mMenuListModel = MenuListModel()

    override fun getListChannel() {
        val map = ParamsMap()
        map.put(DefineKey.CHANNEL_TYPE, v?.getChannelType() ?: 2)
        mMenuListModel.getListChannel(map, object : CallBack<List<ChannelBean>>() {
            override fun onSuccess(t: BaseBean<List<ChannelBean>>) {
                v?.onChannelListSuccess(t.data!!)
            }
        })
    }
}